package com.apps.java.javanote02;


public class MyThread extends Thread{
    public MyThread(){

    }

    public MyThread(String name){
        super(name);
    }

    @Override
    public void run() {
        for(int i=0 ; i<100 ; i++){
            //String getName()：返回此线程的名称
            System.out.println(getName() + i);
        }
    }

	/*
	private char name[];

	//Thread无参构造方法
	public Thread() {
		init(null, null, "Thread-" + nextThreadNum(), 0);
	}

	public Thread(String name) {
		init(null, null, name, 0);
	}

	private void init(ThreadGroup g, Runnable target, String name,
                      long stackSize) {
        init(g, target, name, stackSize, null);
    }

    private void init(ThreadGroup g, Runnable target, String name,
                  long stackSize, AccessControlContext acc) {
     	this.name = name.toCharArray();
    }

    public final String getName() {
        return String.valueOf(name);
    }

	private static int threadInitNumber;
    private static synchronized int nextThreadNum() {
        return threadInitNumber++;//0,1,...
    }
    */
}